﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using BTN04.DTO;

namespace BTN04.USER
{
    public partial class ThemSanPhamVaoGioHang : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                ViewState["ReUrl"] = Request.UrlReferrer.ToString();
                if (Request.QueryString["idSanPham"] != null)
                {
                    int masp = int.Parse(Request.QueryString["idSanPham"]);
                    CartItem cart = new CartItem(masp ,1);
                    CurrentContext.Cart.AddItem(cart);
                    (Master as Template.USER).HienThiSoLuong();
                    string url = ViewState["ReUrl"].ToString();
                    Response.Redirect(url);
                }
            }
        }
    }
}
